//
//  AttentionTableViewCell.m
//  滴滴快拍
//
//  Created by dllo on 16/5/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "AttentionTableViewCell.h"

@implementation AttentionTableViewCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
    
}

- (void)createView {
    self.backgroundColor = [UIColor whiteColor];
    //    self.contentView.backgroundColor = [UIColor clearColor];
    
    self.picImageView = [[BaseImageView alloc] init];
    [self.contentView addSubview:self.picImageView];
    
    self.titleLabel = [[BaseLabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    
    
    
    self.attentionButton = [BaseButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:self.attentionButton];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.picImageView.frame = CGRectMake(20, 10, 60, 60);
    self.picImageView.layer.masksToBounds = YES;
    self.picImageView.layer.cornerRadius = 30;
    
    self.titleLabel.frame = CGRectMake(100, 30, 100, 20);
    
    
    
    self.attentionButton.frame = CGRectMake(SCREEN_WIDTH - 100, 20, 80, 30);
    self.attentionButton.backgroundColor = [UIColor colorWithRed:232 / 255.0 green:232 / 255.0 blue:232 / 255.0 alpha:1];
    self.attentionButton.layer.cornerRadius = 5;
    self.attentionButton.layer.masksToBounds = YES;
     [self.attentionButton addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];

    }


- (void)click:(BaseButton *)sender {
    if (self.attentionBlock) {
        self.attentionBlock(sender);
        
    }




}

@end
